package com.liveneo.adapter.base.servlet;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.liveneo.adapter.mobile.util.SysConst;

/**
 * @Title:
 * @Description: 自启动servlet，加载一些配置文件用的
 * @Author:YJX
 * @Since:2015-8-5 下午05:41:43
 * @Version:1.0.0
 * @Copyright (c) 北京朗泰恒盛信息技术有限公司-版权所有
 */
public class MsplatfromInit extends HttpServlet {
    
     /**
     * 序列化ID
     */
     
    private static final long serialVersionUID = 1L;

    protected void doGet(HttpServletRequest request, HttpServletResponse response) {
        doPost(request, response);
    }

    protected void doPost(HttpServletRequest request, HttpServletResponse response) {
        try {
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void init() {
        String configPath = getServletContext().getRealPath("/");
        String sysConstConfig = configPath + "WEB-INF/classes/SysConstConfig.xml";
        try {
            if (SysConst.isInited() == false) {
                SysConst.init(sysConstConfig, false);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
